package com.ruoyi.business.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.business.domain.SysUserLoginCompany;
import com.ruoyi.business.domain.vo.SysUserLoginCompanyVo;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.mapper.BaseMapperPlus;

/**
 * 公司信息Mapper接口
 *
 * @author ruoyi
 * @date 2024-04-20
 */
public interface SysUserLoginCompanyMapper extends BaseMapperPlus<SysUserLoginCompanyMapper, SysUserLoginCompany, SysUserLoginCompanyVo> {

    /**
     * 根据公司名称查询公司信息
     *
     * @param companyName
     * @return
     */
   default SysUserLoginCompany selectByName(String companyName){
        return selectOne(new LambdaQueryWrapper<SysUserLoginCompany>()
            .eq(SysUserLoginCompany::getCompanyName, companyName)
        );
   }

    /**
     * 根据手机号查询公司信息
     * @param phone
     * @return
     */
    SysUserLoginCompany selectByPhone(String phone);

    /**
     * 根据用户id查询公司信息
     * @param userId
     * @return
     */
    SysUserLoginCompany selectByUserId(Long userId);

    /**
     * 通过手机号查询对应用户
     * @param phonenumber
     * @return
     */
    SysUser selectUserByPhone(String phonenumber);
}
